home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 97 / CD-ROM 97 / CD-ROM 97.iso / internet / ghostzilla / ghsetup.exe / chrome / comm.jar / content / editor / EdImageMapHotSpot.js < prev    next >
Encoding:
JavaScript  |  2002-04-09  |  2.5 KB  |  86 lines

  1. /*
  2.  * The contents of this file are subject to the Netscape Public
  3.  * License Version 1.1 (the "License"); you may not use this file
  4.  * except in compliance with the License. You may obtain a copy of
  5.  * the License at http://www.mozilla.org/NPL/
  6.  *
  7.  * Software distributed under the License is distributed on an "AS
  8.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9.  * implied. See the License for the specific language governing
  10.  * rights and limitations under the License.
  11.  *
  12.  * The Original Code is Mozilla Communicator client code, released
  13.  * March 31, 1998.
  14.  *
  15.  * The Initial Developer of the Original Code is Netscape
  16.  * Communications Corporation. Portions created by Netscape are
  17.  * Copyright (C) 1998-2000 Netscape Communications Corporation. All
  18.  * Rights Reserved.
  19.  *
  20.  * Contributor(s):
  21.  *   Dan Haddix
  22.  */
  23.  
  24. // dialog initialization code
  25. function Startup()
  26. {
  27.   if (!InitEditorShell())
  28.     return;
  29.  
  30.   gDialog.urlInput = document.getElementById("urlInput");
  31.   gDialog.targetInput = document.getElementById("targetInput");
  32.   gDialog.altInput = document.getElementById("altInput");
  33.   gDialog.commonInput = document.getElementById("commonInput");
  34.  
  35.   gDialog.hsHref = window.arguments[0].getAttribute("hsHref");
  36.   if (gDialog.hsHref != '')
  37.     gDialog.urlInput.value = gDialog.hsHref;
  38.  
  39.   gDialog.hsAlt = window.arguments[0].getAttribute("hsAlt");
  40.   if (gDialog.hsAlt != '')
  41.     gDialog.altInput.value = gDialog.hsAlt;
  42.  
  43.   gDialog.hsTarget = window.arguments[0].getAttribute("hsTarget");
  44.   if (gDialog.hsTarget != ''){
  45.     gDialog.targetInput.value = gDialog.hsTarget;
  46.     len = gDialog.commonInput.length;
  47.     for (i=0; i<len; i++){
  48.       if (gDialog.hsTarget == gDialog.commonInput.options[i].value)
  49.         gDialog.commonInput.options[i].selected = "true";
  50.     }
  51.   }
  52.  
  53.   SetTextboxFocus(gDialog.urlInput);
  54.  
  55.   SetWindowLocation();
  56. }
  57.  
  58. function onAccept()
  59. {
  60.   dump(window.arguments[0].id+"\n");
  61.   window.arguments[0].setAttribute("hsHref", gDialog.urlInput.value);
  62.   window.arguments[0].setAttribute("hsAlt", gDialog.altInput.value);
  63.   window.arguments[0].setAttribute("hsTarget", gDialog.targetInput.value);
  64.  
  65.   SaveWindowLocation();
  66.  
  67.   window.close();
  68. }
  69.  
  70. function changeTarget() {
  71.   gDialog.targetInput.value=gDialog.commonInput.value;
  72. }
  73.  
  74. function chooseFile()
  75. {
  76.   // Get a local file, converted into URL format
  77.  
  78.   fileName = GetLocalFileURL("html");
  79.   if (fileName && fileName != "") {
  80.     gDialog.urlInput.value = fileName;
  81.   }
  82.  
  83.   // Put focus into the input field
  84.   SetTextboxFocus(gDialog.urlInput);
  85. }
  86.